A data processing system uses an operating system (OS) to manage the hardware and software resources of the computer. The OS is a software program that performs basic tasks, such as controlling and allocating memory, prioritizing the processing of instructions, controlling input and output devices, facilitating networking, and managing files. The OS also provides application program interfaces (APIs) to enable the application programs to interact with the hardware and software resources as well as with other application programs.
As more and more services are becoming available for data processing systems, the number of programs running in a system has increased significantly. Each of these programs typically consumes a certain amount of resources such as memory. Some of the programs may cause memory leaks. For example, a program may allocate a block of memory and fail to properly release the memory block once it is done. Overtime, the available memory to be allocated to other programs becomes less and less. Although the density of memory devices continues to increase, memory capacities are still very limited.
Usually, a system monitors memory usage by multiple running applications to ensure availability of a required capacity of free memory. In some systems, when memory usage reaches a critical level, the system takes memory management actions to increase the size of free memory, such as activating a garbage collection procedure to obtain allocated memories from applications which are no longer running. The system may also target a selected application, such as by simply killing the application. In some situations, it is useful or important to identify who causes the memory leaks in order to further improve the overall system. Typically, it is difficult to identify the cause of memory leaks within a single multipurpose program such as an operating system kernel. However, there has been a lack of an efficient mechanism to track or pinpoint the offenders that cause the memory leaks.